package com.cryptape.cita_wallet.constant.url;

import com.cryptape.cita_wallet.constant.ConstantUtil;
import com.cryptape.cita_wallet.service.http.Api;
import com.cryptape.cita_wallet.util.ether.EtherUtil;

import static com.cryptape.cita_wallet.service.http.Api.BASE_LOCAL_URL;

/**
 * Created by duanyytop on 2018/8/6
 */
public class HttpUrls {

    // setting module's url list
    public static final String SOURCE_CODE_GITHUB_URL = "https://github.com/cryptape/neuron-android";
    public static final String PRODUCT_AGREEMENT_URL = "https://docs.nervos.org/cyton-android/#/product-agreement";
    public static final String NERVOS_WEB_URL = "https://www.nervos.org/";
    public static final String OPEN_SEA_URL = "https://opensea.io/";
    public static final String INFURA_URL = "https://infura.io/";
    public static final String CITAHUB_TALK_URL = "https://talk.citahub.com/";
    public static final String PECKSHEILD_URL = "https://peckshield.com/";
    public static final String CITA_GITHUB_URL = "https://github.com/cryptape/cita";

    // Discover page config information
    public static final String DISCOVER_URL = "https://dapp.cryptape.com";

    //Token Currency ID Price
    public static final String TOKEN_ID = "https://api.coinmarketcap.com/v2/listings/";
    public static final String TOKEN_CURRENCY = "https://api.coinmarketcap.com/v2/ticker/@ID/?convert=@Currency";
    public static final String COLLECTION_LIST_URL = "https://api.opensea.io/api/v1/assets/?owner=";
    // Image url
    public static final String DEFAULT_WEB_IMAGE_URL = "https://cdn.cryptape.com/neuron/default_web_icon.png";

    //Token Describe
    public static final String TOKEN_LOGO = "https://github.com/consenlabs/token-profile/blob/master/images/%s.png?raw=true";
    public static final String TOKEN_DESC = "https://raw.githubusercontent.com/consenlabs/token-profile/master/erc20/%s.json";
    public static final String TOKEN_ERC20_DETAIL = "https://ntp.staging.cryptape.com?token=%s";
    public static final String TOKEN_DETAIL = "https://ntp.cryptape.com?coin=%s";

    //Eth Transaction Detail
    public static final String ETH_MAINNET_TRANSACTION_DETAIL = "https://etherscan.io/tx/%s";
    public static final String ETH_MAINNET_CN_TRANSACTION_DETAIL = "https://cn.etherscan.com/tx/%s";
    public static final String ETH_RINKEBY_TRANSACTION_DETAIL = "https://rinkeby.etherscan.io/tx/%s";
    public static final String ETH_ROPSTEN_TRANSACTION_DETAIL = "https://ropsten.etherscan.io/tx/%s";
    public static final String ETH_KOVAN_TRANSACTION_DETAIL = "https://kovan.etherscan.io/tx/%s";

    //CITA Transaction Detail
    public static final String CITA_TEST_TRANSACTION_DETAIL = "http://microscope.cryptape.com/#/transaction/%s";

    /**
     * @return 基础url
     */
    public static String getBaseUrl() {
        return ConstantUtil.isTestMode ? Api.BASE_TEST_URL : Api.BASE_URL;
    }

    /**
     * 转账记录
     */
    public static String getTRANSACTIONRECORD() {
        return getBaseUrl() + Api.TRANSACTIONRECORD;
    }

    /**
     * 备份MID用户
     */
    public static String getUSERBACKUP() {
        return getBaseUrl() + Api.USERBACKUP;
    }

    /**
     * 推送全部检测
     */
    public static String getALLDETECTION() {
        return getBaseUrl() + Api.ALLDETECTION;
    }

    /**
     * 推送绑定
     */
    public static String getbindRegistration() {
        return getBaseUrl() + Api.BINDREGISTRATION;
    }

    /**
     * 指数
     */
    public static String getIndexMarkIndexUrl() {
        return getBaseUrl() + Api.INDEXMARKINDEX;
    }

    /**
     * 社群
     */
    public static String getMangoassociationUrl() {
        return getBaseUrl() + Api.MANGOASSOCIATION_URL;
    }

    /**
     * 社群
     */
    public static String getMortgageAssociationUrl() {
        return getBaseUrl() + Api.MORTGAGE_ASSOCIATION;
    }

    /**
     * 实时数据
     */
    public static final String getRealTimeIndexUrl() {
        return getBaseUrl() + Api.REALTIMEINDEX;
    }

    /**
     * 提取收益
     */
    public static String getWithdrawMinerIncome() {
        return getBaseUrl() + Api.WITHDRAW_MINER_INCOME;
    }

    /**
     * 轻节点
     */
    public static String getLightNodeUrl() {
        return getBaseUrl() + Api.LIGHTNODE;
    }

    /**
     * 节点页面
     */
    public static String getNodeUrl() {
        return getBaseUrl() + Api.NODE;
    }

    /**
     * 我的激励
     */
    public static String getMyorderWalletUrl() {
        return getBaseUrl() + Api.MYORDERWALLET;
    }

    /**
     * 提取收益首页
     */
    public static String getMiningOrderIncomeIndex() {
        return getBaseUrl() + Api.WITHDRAW_MINER_INCOME_INDEX;
    }

    /**
     * 节点首页
     */
    public static String getMangonodeUrl() {
        return getBaseUrl() + Api.MANGONODE_URL;
    }

    /**
     * 持币生息首页
     */
    public static String getChibiUrl() {
        return getBaseUrl() + Api.CHIBI_URL;
    }

    /**
     * 挖矿抵押
     */
    public static String getMortgageMiningUrl() {
        return getBaseUrl() + Api.MORTGAGE_MINING;
    }

    /**
     * 保存当前语言
     */
    public static String uploadUserAppLangUrl() {
        return getBaseUrl() + Api.SET_USERAPPLANG;
    }

    /**
     * 获取当前语言
     */
    public static String getUserAppLangUrl() {
        return getBaseUrl() + Api.GET_USERAPPLANG;
    }

    /**
     * 获取版本信息
     */
    public static String getVersionUrl() {
        return getBaseUrl() + Api.VERSION_URL;
    }

    /**
     * 获取我的云矿机
     */
    public static String getMyHMIOOrders() {
        return getBaseUrl() + Api.MY_HMIO_ORDERS;
    }

    /**
     * 获取我的云矿机收益明细
     */
    public static String getMiningOrderIncome() {
        return getBaseUrl() + Api.MINING_ORDER_INCOME;
    }

    /**
     * 绑定mid
     */
    public static String getBindMIDUrl() {
        return getBaseUrl() + Api.BIND_MID;
    }

    /**
     * 获取mid
     */
    public static String getFindMIDUrl() {
        return getBaseUrl() + Api.FIND_MID;
    }

    public static String getCouldOrder() {
        return getBaseUrl() + Api.COULD_ORDER;
    }

    public static String getCouldTransactionAdd() {
        return getBaseUrl() + Api.COULD_TRANSACTION_ADD;
    }

    public static String getVGrade() {
        return getBaseUrl() + Api.V_GRADE;
    }
}
